package com.zhuangjie.order.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 提交订单dto
 *
 * @author zhuangjie
 * @date 2023/11/24
 */
@Data
public class SubmitOrderDTO {
    /*不可修改属性*/
    @ApiModelProperty(value = "店铺id")
    @NotNull(message = "店铺id不能为空")
    private Long shopId;
    @ApiModelProperty(value = "经营类型-取货方式(1支持配送、2支持店食、3、支持自提）")
    @NotNull(message = "交付方式不能为空！")
    private String receivingMethod;
    @ApiModelProperty(value = "是否尽快")
    private Integer isImmediate;
    @ApiModelProperty(value = "指定的预计交付时间")
    private LocalDateTime specifiedTime;
    @ApiModelProperty(value = "收货地址id")
    private Long addressBookId;

    /*可修改属性*/
    @ApiModelProperty(value = "座位号")
    private String seatNumber;
    @ApiModelProperty(value = "备注信息")
    private String remark;


    /**
     * false表示先平台券再店铺券
     * true表示先店铺券再平台券
     */
    @NotNull
    private Boolean isPlatformCouponFirst;

    /**
     * 平台满减券
     */
    private List<Long> platformCouponIds;

    /**
     * 店铺 满减券/折扣券
     */
    private List<Long> shopCouponIds;



    public boolean isImmediate() {
        return isImmediate == 1;
    }
}
